<%@ page import="ru.resumeService.model.Resume" %>
<%@ page import="java.util.List" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Edit resume</title>
</head>
<body>
<%
    Resume resume = (Resume) request.getAttribute("resume");
    String successUpdate = (String) request.getAttribute("successUpdate");
    if (resume != null) {
%>
<p align="center" style="font-size:20px;">Редактировать резюме</p>
<%
    if (successUpdate!=null){
%>
<p align="center" style="font-size:15px; color: red"><%=successUpdate%></p>
<%
    }
%>
<form method="post" action="edit">
    <table border="1" class="resume">
        <th>Id </th>
        <th>ФИО</th>
        <th>Телефон</th>
        <th>Почта</th>
        <th>Дата</th>
        <th>Подразделение</th>
        <th>Город</th>
        <th>Возраст</th>
        <th>Образование</th>
        <th>Опыт работы</th>
        <th>Зарплата</th>
        <th>Основные навыки</th>
        <th>Работает/не работает</th>
        <th>Комментарий</th>

        <tr>
            <td><input type="text" style="width: 30px;" name="id" value="<%=resume.getId()%>" readonly>
            </td>
        <td><input type="text" style="width: 220px;" name="name" value="<%=resume.getName()%>">
        </td>
        <td><input type="text" style="width: 120px;" name="phone" value="<%=resume.getPhone()%>">
        </td>
        <td><input type="text" name="email" style="width: 120px;" value="<%=resume.getEmail()%>">
        </td>
        <td><input type="date" name="date" value="<%=resume.getDate()%>">
        </td>
        <td><textarea type="text" rows="3" cols="20"  name="department" maxlength="49"><%=resume.getDepartment()%></textarea>
        </td>
        <td><input type="text" style="width: 80px;" name="city" value="<%=resume.getCity()%>">
        </td>
        <td><input type="number" style="width: 50px;" name="age" value="<%=resume.getAge()%>">
        </td>
        <td><input type="text" style="width: 120px;" name="education" value="<%=resume.getEducation()%>">
        </td>
        <td><input type="number" style="width: 80px;" name="experience" value="<%=resume.getExperience()%>">
        </td>
        <td><input type="number" style="width: 80px;" name="salary" value="<%=resume.getSalary()%>">
        </td>
        <td><textarea type="text" rows="3" cols="25" name="skills"><%=resume.getSkills()%></textarea>
        </td>
        <td>
            <% if (resume.getStatus() == 1) { %>
            <input type="text" style="width: 100px;" name="status" value="работает">
            <% } else { %>
            <input type="text" style="width: 100px;" name="status" value="не работает">
            <% } %>
        </td>
        <td>
            <textarea type="text" rows="3" cols="25" name="comments"><%=resume.getComments()%></textarea>
        </td>
        </tr>
    </table>
    <br/>
    <input type="submit" name="id" value="Редактировать">
    <input value="Список резюме" onclick="location.href='resumeList'" type="button"/>
</form>
<%
    }
%>
</body>
</html>